
expdir=$1
stage=0
num_gpus=4

asr_zh=(
#"test_20241119_aishell2_mic"
#"test_20241119_aishell2_android"
#"test_20241119_aishell2_ios"
"test_20221110_tlmeetwebinar_10h"
"test_20211229_wenetspeech_meeting_org_fbankhires"
)
asr_zhen=(
"test_20220221_ailab_5h_org_fbankhires"
"test_20220509_tal_5h_org_fbankhires"
)

asr_en=(
"test_20220407_librispeech_clean_org_fbankhires"
"test_20220407_librispeech_other_org_fbankhires"
)

asr_draft=(
"valid_20240322_cn_slides_1100h"
"test_20241119_slidespeech"
)
asr_multi=(
"valid_20240322_cn_slides_1100h_asr_multi"
)
asr_test=(
"test_aishell1"
"dev_aishell1"
)
combined_list=(
${asr_draft[@]}
${asr_zh[@]}
${asr_zhen[@]}
#${asr_multi[@]}
${asr_en[@]}
)
asr_list=(
${asr_draft[@]}
#${asr_test[@]}
#${asr_zh[@]}
#${asr_zhen[@]}
#${asr_en[@]}
)
diar_list=(
${asr_multi[@]}
)
mkdir -p $expdir/tests
if [ $stage -le 0 ]; then

        echo "1. Evaluating ASR"
        orig_dir=/apdcephfs_qy3/share_976139/users/adrenzhou/audio_llm/raw_data/processed
	#for dataset in ${combined_list[@]}; do
	#for dataset in valid_20250324_cn_slides; do
	for dataset in valid_20240322_cn_slides_1100h; do
		out_dir=$expdir/tests/$dataset
		mkdir -p $out_dir
		python batch_infer_qwen2_audio.py --input_data $orig_dir/${dataset}.jsonl --output_data $out_dir/result.jsonl --model_path $expdir --batch_size 4 --num_gpus $num_gpus
		python tools/collect_and_wer.py $out_dir/result.jsonl $out_dir/text.ref $out_dir/text.hyp $out_dir/wer &
		echo $out_dir/wer
	done
fi
wait

exit 0
if [ $stage -le 1 ]; then

        echo "2. Evaluating DIAR"
        orig_dir=/apdcephfs_qy3/share_976139/users/adrenzhou/audio_llm/raw_data/processed
	for dataset in ${diar_list[@]}; do
		out_dir=$expdir/tests/$dataset
		mkdir -p $out_dir
		python batch_infer_qwen2_audio.py --input_data $orig_dir/${dataset}.jsonl --output_data $out_dir/result.jsonl --model_path $expdir --batch_size 3 --num_gpus $num_gpus

	done
fi

